package com.yk._15单例模式;

public class _02LazySingle {

    private static volatile _02LazySingle instance;
    private _02LazySingle() {
    } //1 .私有化构造方法
    //双重检验,支持多线程
    public _02LazySingle getInstance() {
        if (instance == null) {
            synchronized (_02LazySingle.class) {
                if (instance == null) {
                    instance = new _02LazySingle();
                }
            }
        }
        return instance;
    } // 3.public的get方法
}
